from base import Base
from selenium.webdriver.common.by import By
from time import sleep

class Sousuo(Base):
    #点击搜索框
    djssk = (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.FrameLayout[2]/android.widget.RelativeLayout/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]')
    #输入框
    srk = (By.ID,'com.kongfz.app:id/etContent')
    #点击搜索
    djss = (By.XPATH,'//android.widget.TextView[@text = "搜索"]')
    #断言
    dy = (By.XPATH,'//android.widget.FrameLayout[@resource-id = com.kongfz.app:id/fl1]')

    def suosuoyewu(self,nr):
        #点击输入框
        self.find_ele(self.djss).click()
        #强制等待
        sleep(4)
        #输入框输入内容
        self.find_ele(self.srk).send_keys(nr)
        sleep(3)
        #点击搜索
        self.find_ele(self.djss).click()

